﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ST.Buz.Base.Entity;

namespace ST.Buz.Base.Mapping
{
	public partial class Map_WX_Session : IEntityTypeConfiguration<WX_Session>
	{
		public void Configure(EntityTypeBuilder<WX_Session> builder)
		{
			builder.HasIndex(m => new { m.AppID, m.OpenID })
				.HasName("IX_Sys_WXSessionMap_AppID_OpenID")
				.IsClustered(false);

			builder.Property(e => e.AppID)
				.IsUnicode(false);

			builder.Property(e => e.OpenID)
				.IsUnicode(false);

			builder.Property(e => e.UnionID)
				.IsUnicode(false);

			builder.Property(e => e.ExpireDate);

			builder.Property(e => e.AddDate)
				.HasDefaultValueSql("(getdate())")
				.ValueGeneratedNever();
		}
	}
}
